import { lazy } from "react";
import { Navigate, createBrowserRouter } from "react-router-dom";
let Home = lazy(() => import("../views/Home/Home"))//首页
let Message = lazy(() => import("../views/Message/Message"))//客服聊天页面
let City = lazy(() => import("../views/City/City"))//城市列表页面
let Login = lazy(() => import("../views/Login/Login"))//登录页面
let List = lazy(() => import("../views/List/List"))//列表页面
let Detail = lazy(() => import("../views/Detail/Detail"))//详情页面
let Time = lazy(() => import("../views/Time/Time"))//时间页面
let FlightHome = lazy(() => import("../views/FlightHome/FlightHome"))//机票首页
const routes = createBrowserRouter([
    {
        path: "/",
        element: <Navigate to="/Home"></Navigate>
    },
    {
        path: "/Home",
        element: <Home></Home>
    },
    {
        path: "/Login",
        element: <Login></Login>
    },
    {
        path: "/Message",
        element: <Message></Message>
    },
    {
        path: "/List",
        element: <List></List>
    },
    {
        path: "/Detail/:id",
        element: <Detail></Detail>
    },
    {
        path: "/City",
        element: <City></City>
    },
    {
        path: "/FlightHome",
        element: <FlightHome></FlightHome>
    },
    {
        path: "/Time",
        element: <Time></Time>
    },
])
export default routes